AppCompatTextView

(SESL variant) A TextView which supports compatible features on older versions of the platform, including:

  • Allows dynamic tint of its background via the background tint methods in androidx.core.view.ViewCompat.
  • Allows setting of the background tint using backgroundTint and backgroundTintMode.
  • Supports auto-sizing via androidx.core.widget.TextViewCompat by allowing to instruct a TextView to let the size of the text expand or contract automatically to fill its layout based on the TextView's characteristics and boundaries. The style attributes associated with auto-sizing are autoSizeTextType, autoSizeMinTextSize, autoSizeMaxTextSize, autoSizeStepGranularity and autoSizePresetSizes, all of which work back to Ice Cream Sandwich.

This will automatically be used when you use TextView in your layouts and the top-level activity / dialog is provided by appcompat. You should only need to manually use this class when writing custom views.

Inheritors

Constructors

Link copied to clipboard
constructor(@NonNull context: @NonNull Context)
constructor(@NonNull context: @NonNull Context, @Nullable attrs: @Nullable AttributeSet)
constructor(@NonNull context: @NonNull Context, @Nullable attrs: @Nullable AttributeSet, defStyleAttr: Int)

Functions

Link copied to clipboard
This should be accessed via getAutoSizeMaxTextSize
Link copied to clipboard
This should be accessed via getAutoSizeMinTextSize
Link copied to clipboard
Link copied to clipboard
This should be accessed via getAutoSizeTextType
Link copied to clipboard
Link copied to clipboard
@RequiresApi(value = 26)
@Nullable
open fun getFontVariationSettings(): @Nullable String
Link copied to clipboard
Link copied to clipboard
This should be accessed via getBackgroundTintList
Link copied to clipboard
This should be accessed via getBackgroundTintMode
Link copied to clipboard
This should be accessed via getCompoundDrawableTintList
Link copied to clipboard
This should be accessed via getCompoundDrawableTintMode Returns the blending mode used to apply the tint to the compound drawables, if specified.
Link copied to clipboard
open fun getText(): CharSequence
Link copied to clipboard
@RequiresApi(api = 26)
@NonNull
open fun getTextClassifier(): @NonNull TextClassifier
Returns the TextClassifier used by this TextView.
Link copied to clipboard
Gets the parameters for text layout precomputation, for use with PrecomputedTextCompat.
Link copied to clipboard
@Nullable
open fun getTypeface(): @Nullable Typeface
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun seslSetButtonShapeEnabled(enabled: Boolean, textColor: Int)
Link copied to clipboard
open fun setAllCaps(allCaps: Boolean)
open fun setAutoSizeTextTypeUniformWithConfiguration(autoSizeMinTextSize: Int, autoSizeMaxTextSize: Int, autoSizeStepGranularity: Int, unit: Int)
open fun setAutoSizeTextTypeUniformWithPresetSizes(presetSizes: @NonNull Array<Int>, unit: Int)
This should be accessed via setAutoSizeTextTypeUniformWithPresetSizes
Link copied to clipboard
This should be accessed via setAutoSizeTextTypeWithDefaults
Link copied to clipboard
open fun setBackgroundDrawable(@Nullable background: @Nullable Drawable)
Link copied to clipboard
Link copied to clipboard
open fun setCompoundDrawables(@Nullable left: @Nullable Drawable, @Nullable top: @Nullable Drawable, @Nullable right: @Nullable Drawable, @Nullable bottom: @Nullable Drawable)
Link copied to clipboard
open fun setCompoundDrawablesRelative(@Nullable start: @Nullable Drawable, @Nullable top: @Nullable Drawable, @Nullable end: @Nullable Drawable, @Nullable bottom: @Nullable Drawable)
open fun setCompoundDrawablesRelativeWithIntrinsicBounds(@Nullable start: @Nullable Drawable, @Nullable top: @Nullable Drawable, @Nullable end: @Nullable Drawable, @Nullable bottom: @Nullable Drawable)
open fun setCompoundDrawablesRelativeWithIntrinsicBounds(start: Int, top: Int, end: Int, bottom: Int)
Link copied to clipboard
open fun setCompoundDrawablesWithIntrinsicBounds(@Nullable left: @Nullable Drawable, @Nullable top: @Nullable Drawable, @Nullable right: @Nullable Drawable, @Nullable bottom: @Nullable Drawable)
open fun setCompoundDrawablesWithIntrinsicBounds(left: Int, top: Int, right: Int, bottom: Int)
Link copied to clipboard
open fun setEmojiCompatEnabled(enabled: Boolean)
Configure emoji fallback behavior using EmojiCompat.
Link copied to clipboard
open fun setFilters(filters: @NonNull Array<InputFilter>)
Link copied to clipboard
open fun setFirstBaselineToTopHeight(@Px @IntRange(from = 0) firstBaselineToTopHeight: Int)
Link copied to clipboard
@RequiresApi(value = 26)
open fun setFontVariationSettings(@Nullable fontVariationSettings: @Nullable String): Boolean
Set font variation settings.
Link copied to clipboard
open fun setLastBaselineToBottomHeight(@Px @IntRange(from = 0) lastBaselineToBottomHeight: Int)
Link copied to clipboard
open fun setLineHeight(@Px @IntRange(from = 0) lineHeight: Int)
open fun setLineHeight(unit: Int, @FloatRange(from = 0) lineHeight: Float)
Link copied to clipboard
open fun setPrecomputedText(@NonNull precomputed: @NonNull PrecomputedTextCompat)
Sets the PrecomputedTextCompat to the TextView.
Link copied to clipboard
open fun setSupportBackgroundTintList(@Nullable tint: @Nullable ColorStateList)
This should be accessed via setBackgroundTintList
Link copied to clipboard
This should be accessed via setBackgroundTintMode
Link copied to clipboard
open fun setSupportCompoundDrawablesTintList(@Nullable tintList: @Nullable ColorStateList)
This should be accessed via setCompoundDrawableTintList Applies a tint to the compound drawables.
Link copied to clipboard
This should be accessed via setCompoundDrawableTintMode Specifies the blending mode used to apply the tint specified by setSupportCompoundDrawablesTintList to the compound drawables.
Link copied to clipboard
open fun setTextAppearance(context: Context, resId: Int)
Link copied to clipboard
@RequiresApi(api = 26)
open fun setTextClassifier(@Nullable textClassifier: @Nullable TextClassifier)
Sets the TextClassifier for this TextView.
Link copied to clipboard
open fun setTextFuture(@Nullable future: @Nullable Future<PrecomputedTextCompat>)
Set the precomputed text future.
Link copied to clipboard
Apply the text layout parameter.
Link copied to clipboard
open fun setTextSize(unit: Int, size: Float)
Link copied to clipboard
open fun setTypeface(@Nullable tf: @Nullable Typeface)
open fun setTypeface(@Nullable tf: @Nullable Typeface, style: Int)